/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package imp.reciever.scriptexecuter;

import dom.command.Result;
import java.io.InputStream;
import java.io.OutputStream;

/**
 *
 * @author julian.pena
 */
public class SHExecuter implements ScriptExecuter{
    
    private String path;

    public SHExecuter(String path) {
        this.path = path;
    }

    @Override
    public Result excuteScript() throws Exception {
        
        Runtime.getRuntime().exec("/bin/sh " + path);
        
        return null;
    }

    @Override
    public void action() throws Exception {
        Result r = excuteScript();
    }
    
    @Override
    public InputStream getInputStream() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setInputStream(InputStream inputStream) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public OutputStream getOutputStream() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setOutputStream(OutputStream outputStream) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    //<editor-fold defaultstate="collapsed" desc="getters and setters">
    public String getPath() {
        return path;
    }
    
    public void setPath(String path) {
        this.path = path;
    }
    //</editor-fold>
}
